home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / comm / wxmodem.zip / WXMOMISC.INC < prev    next >
Text File  |  1986-10-16  |  1KB  |  62 lines

  1. {$U-,C-,R-}
  2. function scan(var extend : boolean; var code : byte) : boolean;
  3. {
  4.  Uses BIOS service 16 to get a keystroke w/o echo. Sets 'extend' true
  5.  for extended codes from PC-Clone keyboards, and returns ASCII/Scan code
  6.  in 'code'.  Returns true if a character exists, false if none is in the
  7.  buffer.
  8. }
  9. type
  10.     regs = record
  11.       ax,bx,cx,dx,bp,si,di,ds,es,flags : integer;
  12.     end;
  13. var
  14.    r : regs;
  15.    c : integer;
  16. begin
  17.      code := 0;
  18.      r.ax := 1 shl 8;     {AH := 1}
  19.      Intr($16,r);
  20.      if r.flags and 64 <> 64 then
  21.      begin
  22.     r.ax := 0;
  23.     Intr($16,r);     {Get character and clear from buffer}
  24.     code := lo(r.ax);
  25.     scan := true;
  26.     extend := false;
  27.     if  code = 0 then
  28.     begin
  29.        extend := true;
  30.        code := hi(r.ax)
  31.     end;
  32.      end
  33.      else
  34.     scan := false;
  35. end;
  36.  
  37. function exists(fname :  bigstring) : boolean;
  38. var
  39.    f : file;
  40. begin
  41.      assign(f, fname);
  42.      {$I-}
  43.      reset(f);
  44.      {$I+}
  45.      if IOresult = 0 then
  46.     begin
  47.          exists := true;
  48.          close(f)
  49.     end
  50.      else
  51.     exists := false
  52. end;
  53.  
  54. procedure supcase(var s);
  55. var
  56.    ss : bigstring absolute s;
  57.    i : integer;
  58. begin
  59.      for i := 1 to length(ss) do
  60.      ss[i] := upcase(ss[i])
  61. end;
  62.